<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("webApp", basePath);
	request.setAttribute("lib",basePath+"lib/");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>客服-后台群组聊天系统</title>
   	<script type="text/javascript" src="lib/jquery/1.11.3/jquery.min.js"></script>
	<script type="text/javascript" src="lib/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
	<link rel="stylesheet" href="lib/layui/css/layui.css">
	<script src="layui/layui.js"></script>
	<script type="text/javascript" src="lib/kf_manager.js" ></script>
	<script type="text/javascript">
		$(function(){
			//渲染body大小
			$("body").css("height",document.body.offsetHeight);
			//绑定基础事件
			
			$(".btn-kf-start").click(function(){
				$.kefu_manager({
					should_login:true,//决定是否使用默认用户
					ws_url:'ws://127.0.0.1:8080/Jstx/client.c',
					gb:".btn-kf-gb"
				});
			});
			$(".btn-kf-conf").click(function(){
				//检查客服程序运行状态,如果未运行提示用户运行后才能修改,运行时，则在kf_manager.js中绑定update方法
				if("stop"==$.kefu_conf.state){
					$(".btn-kf-start").click();
				}
			});
		});
	</script>
	<style type="text/css">
  	.index-button{margin-bottom: 30px;}
	.index-button div{margin: 20px 30px 10px;}
	.index-button .layui-btn+.layui-btn{margin-left: 0;}
	.index-button .layui-btn{margin: 0 7px 10px 0; }
  </style>
  
  </head>
  
  <body style="height:800px;padding: 20px 20px;">
  <div style="margin: 30px;">
    <fieldset class="layui-elem-field index-button" style="margin-top: 30px;">
	  <legend>控制台</legend>
	  <div>
	    <a class="layui-btn layui-btn-primary btn-kf-start"  href="javascript:void(0)"><i class="layui-icon">&#xe857;</i>启动客服程序</a>
	   	<a class="layui-btn layui-btn-primary btn-kf-gb"  href="javascript:void(0)"><i class="layui-icon">&#xe688;</i>广播消息</a>
	   	<a class="layui-btn layui-btn-primary btn-kf-conf"  href="javascript:void(0)"><i class="layui-icon">&#xe620;</i>客服信息设置</a>
	   	 <div class="layui-text" style="margin: 0; color: #FF5722;">
		      注意：*
		 </div>
<!-- 		 <div class="layui-text" style="margin-top:10px; color: #FF5722;"> -->
<!-- 		       <a href="helpdoc.doc" target="_blank" class="layui-btn  layui-btn-sm layui-bg-blue"><i class="layui-icon">&#xe705;</i>查看文档</a> -->
<!-- 		 </div> -->
	  </div>
	</fieldset>
  </div> 	
  </body>
  
</html>
